﻿using Common;
using Database.Context;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.CommandHandlers
{
    public class CommandHandlerBase
    {
        protected DatabaseContext context;
        public CommandHandlerBase()
        {
            if (context == null)
            {
                context = GetServiceExtension.Services.GetService(typeof(DatabaseContext)) as DatabaseContext;
            }
            
        }
        
        public int GetExamCount()
        {
          return context.ExamInfos.AsNoTracking().Count();
        }
    }
}
